package com.tuyue.police.util;

import java.util.*;

/**
 * @Author: 王金海
 * @Description: 排序
 * @Date: Created by Administrator on 2017/12/8.
 * @Modified By:
 */
public class SortUtil
{
    /**
     * map 排序
     * @param map
     * @return
     */
    public static List mapSort(Map map){
        ArrayList<Map.Entry<String, Object>> list = new ArrayList<Map.Entry<String, Object>>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<String, Object>>() {
            @Override
            public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) {
                return o2.getKey().compareTo(o1.getKey());
            }
        });
        return list;
    }
}
